<%-- 
    Document   : editSpecialist
    Created on : 29 Oct, 2012, 6:46:40 PM
    Author     : santosh
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@include file="../common/script.jsp" %>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
        <script type="text/javaScript">
           
    function onSelect1()
    {  
        var el = document.getElementById('hospitalId');
        var text = el.options[el.selectedIndex].text;
        document.getElementById("hospital1").value=text;  
    }
    function onDefault()
    {
        var el = document.getElementById('hospitalId');
        var text = el.options[el.selectedIndex].text;
        document.getElementById("hospital1").value=text;

    }
    
    var rules=new Array();
    rules[0]='name|required|please enter specialist name';
    rules[1]='specialistTypeId|required|please select specialist type';
    rules[2]='hospitalId|required|please select hospital';
//    rules[3]='mobile|required|please enter mobile';
//    rules[4]='contact|required|please enter contact';
//    rules[5]='email|required|please enter email id';
//    rules[6]='timing1|required|please enter timing1';
//    rules[7]='hospital2|required|please enter hospital2 name';
//    rules[8]='timing2|required|please enter timing2';
//    rules[9]='hospital3|required|please enter hospital3 name';
//    rules[10]='timing3|required|please enter timing3';
//    rules[11]='walkin|required|please enter walkin';   
</script>
    </head>
    <body onLoad="yav.init('form1',rules,'inline'); onDefault();">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <div class="in_02" >
            <%@include file="../common/message.jsp" %>
            <form:form id="form1" modelAttribute="specialist"  method="POST" >
                <fieldset>
                    <legend><spring:message code="title.editSpecialist"/></legend>
                    <fieldset>
                        <table class="formTable">

                            <tr>

                                <td><spring:message code="specialistName"/>:<br/><form:input path="name" id="name" class="userInputLarge"/>
                                <br/><span id="errorsDiv_name"></span></td>
                                <td>Specialist type:<br/><form:select path="specialistTypeId.specialistTypeId" name="specialistTypeId" id="specialistTypeId" style="margin-bottom: 5px">
                                        <form:option value="" label="-"></form:option>
                                        <form:options itemLabel="specialistType" itemValue="specialistTypeId" items="${specialistTypeList}"></form:options>
                                    </form:select>
                                <br/><span id="errorsDiv_specialistTypeId"></span></td>

                                <td>Hospital:<br/><form:select path="hospitalId.hospitalId" name="hospitalId" id="hospitalId" style="margin-bottom: 5px" cssClass="userInputLarge" onchange="onSelect1();">
                                        <form:option value="" label="-"></form:option>
                                        <form:options itemLabel="hospitalName" itemValue="hospitalId" items="${hospitalList}"></form:options>
                                    </form:select>
                                <br/><span id="errorsDiv_hospitalId"></td>

                            </tr>
                            <tr>
                                <td><spring:message code="mobile"/>:<br/><form:input path="mobile" id="mobile" class="userInputLarge"/>
                                <br/><span id="errorsDiv_mobile"></td>
                                <td><spring:message code="contact"/>:<br/><form:input path="contact" id="contact" class="userInputLarge"/>
                                <br/><span id="errorsDiv_contact"></td>
                                <td><spring:message code="email"/>:<br/><form:input path="email" id="email" class="userInputLarge"/>
                                <br/><span id="errorsDiv_email"></td>
                            </tr>
                            <tr>
                                <td><spring:message code="hospital1"/>:<br/>
                                    <%--<form:input path="hospital1" class="userInputLarge"/>--%>
                                    <input type="text" name="hospital1" id="hospital1" value="${hospital1}" readonly="true" class="userInputLarge">
                                </td>
                                <td><spring:message code="timing1"/>:<br/><form:input path="timing1" id="timing1" class="userInputLarge"/>
                                <br/><span id="errorsDiv_timing1"></td>
                            </tr>
                        </table>

                    </fieldset>
                    <fieldset>
                        <legend>Other Details</legend>
                        <table class="formTable">
                            <tr>
                                <td><spring:message code="hospital2"/>:<br/><form:input path="hospital2" id="hospital2" class="userInputLarge"/>
                                <br/><span id="errorsDiv_hospital2"></td>
                                <td><spring:message code="timing2"/>:<br/><form:input path="timing2" id="timing2" class="userInputLarge"/>
                                <br/><span id="errorsDiv_timing2"></td>
                            </tr>
                            <tr>
                                <td><spring:message code="hospital3"/>:<br/><form:input path="hospital3" id="hospital3" class="userInputLarge"/>
                                <br/><span id="errorsDiv_hospital3"></td>
                                <td><spring:message code="timing3"/>:<br/><form:input path="timing3" id="timing3" class="userInputLarge"/>
                                <br/><span id="errorsDiv_timing3"></td>

                            </tr>
                            <tr>
                                <td><spring:message code="walkin"/>:<br/><form:input path="walkin" class="userInputLarge"/>
                                <br/><span id="errorsDiv_walkin"></td>

                            </tr>
                        </table>
                    </fieldset>
                    <table class="formTable">
                        <tr>

                            <td><input type="button" name="Cancel" value="Cancel"  onclick="location.href='../specialist/listSpecialist.htm'"></td>                       
                            <td><input type="submit" name="btnSubmit" class="userInputFormSubmit" value="<spring:message code="button.Update"/>" onclick="return yav.performCheck('form1', rules, 'inline');"/></td>
                        </tr>
                    </table>

                    <spring:hasBindErrors name="specialist">
                        <div class="error">
                            <form:errors path="*"/>
                        </div>
                    </spring:hasBindErrors>
                </fieldset>
            </form:form>
        </div>
    </body>
</html>
